import os
from tqdm import tqdm
imgPath = "JPEGImages"
images=os.listdir(imgPath)
for image in images:

    os.rename(os.path.join(imgPath, image),
              os.path.join(imgPath, image.replace("jpeg", "jpg")))